package com.zhangtai.utils.Excel.office;

import org.apache.commons.beanutils.Converter;

public class IntegerConvert implements Converter {

	@Override
	public Object convert(Class type, Object value) {
		if (value == null) {
			return null;
		}

		if (value instanceof Integer) {
			return value;
		}

		if (value instanceof Long) {
			Long longValue = (Long) value;
			return longValue;
		}

		try {
			return Double.valueOf(value.toString()).intValue();
		} catch (Exception e) {
		}
		return null;
	}

}
